<div id="sidebar-container">

<?php if (is_page('999999999')) { ?>
<?php $total = ($GLOBALS['wpsc_cart']->calculate_subtotal() );
	if($total > 0) { ?>
	<div id="sidebar-header">
		<h2>Shopping Cart</h2>
	</div>
    	<?php dynamic_sidebar( 'sidebar 2' ); ?>
<?php } else { ?>
	<?php // Get Related Upsell Products On Product Page
		query_posts('post_type=wpsc-product&showposts=4&wpsc_product_category=featured');
			if (have_posts()) { ?>
				<h3>Featured SunMaxx Solar Products</h3>
					<ul>
						<?php while (have_posts()) : the_post(); ?>
							<li>
								<a href="<?php echo esc_url( wpsc_the_product_permalink() ); ?>">
									<?php if(wpsc_the_product_thumbnail()) : ?>
										<img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>"/>
									<?php else: ?>
										<img class="no-image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php esc_attr_e( 'No Image', 'wpsc' ); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo WPSC_CORE_THEME_URL; ?>wpsc-images/noimage.png" width="<?php echo get_option('product_image_width'); ?>" height="<?php echo get_option('product_image_height'); ?>" />
									<?php endif; ?>
									<p><?php echo wpsc_the_product_title(); ?></p>
									<p class="sidebarprodbutton">View Product</p>
									<div style="width:100%;height:0px;clear:both;"></div>
								</a>
							</li>
						<?php endwhile; wp_reset_query(); ?>
					</ul>
	<?php } ?>
<?php } ?>
<div style="width:100%;height:1px;background:#e77d1d;margin-bottom:20px;clear:both;"></div>
<?php } ?>

<?php
if ( is_page(array(3957,3983,3977,3986,3959,4052,4045,4041,4027)) ) : ?>
	<div class="sidebar-finance">
    	<?php dynamic_sidebar( 'sidebar 1' ); ?>
    </div>
<?php endif; ?>

<div id="sidebar-cta">
	<h2>Comience Por aqu&#237;!</h2>
	<h3>&#161;Contacte a nuestros expertos Solares!</h3>
	<p>&#191;Tiene preguntas? &#191;Necesita ayuda? &#191;Est&#225; listo(a) para empezar con SunMaxx?</p>
	<p>S&#243;lo tiene que llenar este formulario "de respuesta r&#225;pida" que est&#225; a continuaci&#243;n, y un experto en t&#233;rmica solar se pondr&#225; en contacto directamente con usted a la mayor brevedad posible:</p>
    
	<?php echo do_shortcode('[contact-form-7 id="15081" title="ERPContactForm"]'); ?>
    
<!--
<form action="sidebarformsend.php" method="post">

<p><strong>Name: <em>(required)</em></strong><br />
<input type="text" name="name" value="" class="wpcf7-validates-as-required" size="40" /></p>

<p><strong>Email: <em>(required)</em></strong><br />
<input type="text" name="email" value="" class="wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></p>

<p><strong>Phone: <em>(required)</em></strong><br />
<input type="text" name="phone" value="" class="wpcf7-validates-as-required" size="40" /></p>

<p><strong>How Can We Help You?</strong><br />
<select name="subject"><option value="Please Choose One">Please Choose One</option><option value="Become Dealer / Installer">Become Dealer / Installer</option><option value="Residential Information">Residential Information</option><option value="Commercial Information">Commercial Information</option><option value="Government Information">Government Information</option><option value="Architect / Engineer Information">Architect / Engineer Information</option></select></p>

<p><input type="submit" value="Submit My Request Now!" />
</form>
-->


    
</div>

<div id="sidebar-header">
	<h2>Quick Links</h2>
</div>

<!-- SIEBAR WITH BIG LINKS
<div id="sidebar">
	<div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/solar-installation-training.php"><img src="/wp-content/themes/SunMaxxSolar/images/sidebar-edupower.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/solar-hot-water-information-center.php"><img src="/wp-content/themes/SunMaxxSolar/images/sidebar-document-center.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/technical-tips.php"><img src="/wp-content/themes/SunMaxxSolar/images/sidebar-technical-tips.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/slideshow.php"><img src="/wp-content/themes/SunMaxxSolar/images/sidebar-image-galleries.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/sunmaxx-video-center.php"><img src="/wp-content/themes/SunMaxxSolar/images/sidebar-video-center.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/sunmaxx-solar-projects.php"><img src="/wp-content/themes/SunMaxxSolar/images/sidebar-reference-projects.png" /></a>
</div>
-->

<!-- SIDEBAR WITH SMALL LINKS -->
<div id="sidebar">
	<div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/solar-installation-training.php"><img src="/wp-content/themes/SunMaxxSolar/images/small-sidebar-edupower.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/solar-hot-water-information-center.php"><img src="/wp-content/themes/SunMaxxSolar/images/small-sidebar-document-center.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/technical-tips.php"><img src="/wp-content/themes/SunMaxxSolar/images/small-sidebar-technical-tips.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/slideshow.php"><img src="/wp-content/themes/SunMaxxSolar/images/small-sidebar-image-galleries.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/sunmaxx-video-center.php"><img src="/wp-content/themes/SunMaxxSolar/images/small-sidebar-video-center.png" /></a></div>
    <div class="sidebar-button"><a href="http://www.sunmaxxsolar.com/sunmaxx-solar-projects.php"><img src="/wp-content/themes/SunMaxxSolar/images/small-sidebar-reference-projects.png" /></a>
</div>
    
    <h3><a href="http://www.sunmaxxsolar.com/sunmaxx-solar-hot-water-news-events.php">News &amp; Press ></a></h3>
    
    <ul>
		<?php $recent = new WP_Query("cat=11&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
		<li><a href="<?php the_permalink(); ?>"><?php trim_title(); ?></a></li>
		<?php endwhile; ?>
	</ul>
    
    <h3>Connect With Us Online:</h3>
    
    <div id="facebook"> 
    	<a href="https://www.facebook.com/SunMaxxSolar" target="_blank"><img src="/wp-content/themes/SunMaxxSolar/images/facebook.png" border="0" /></a>
        <a href="https://twitter.com/sunmaxxsolar" target="_blank"><img src="/wp-content/themes/SunMaxxSolar/images/twitter.png" border="0" /></a>
        <a href="http://www.youtube.com/user/SunMaxxSolarInc?feature=mhum" target="_blank"><img src="/wp-content/themes/SunMaxxSolar/images/youtube.png" border="0" /></a>
    
    </div>
    
</div>

</div>